#include "led_test.h"
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>

#define LED_ON  _IOW('L',0,unsigned int)
#define LED_OFF  _IOW('L',1,unsigned int)

static int fd = -1;

int init_light()
{
    fd = open("/dev/gec6818_led_drv",O_WRONLY);
	if(fd == -1)
	{
        printf("open led error\n");
		return fd;
	}
led_onOff(0);
	return 0;
}

void led_onOff(int isOn)
{
    if(isOn == 1)
    {
        ioctl(fd,LED_ON,7);
        ioctl(fd,LED_ON,8);
        //ioctl(fd,LED_ON,9);
        //ioctl(fd,LED_ON,10);
    }
    else
    {
        ioctl(fd,LED_OFF,7);
        ioctl(fd,LED_OFF,8);

        //ioctl(fd,LED_OFF,9);
        //ioctl(fd,LED_OFF,10);
    }
}
